

#ifndef __MEDIA_PLAYER_FILE_LIST_H_
#define __MEDIA_PLAYER_FILE_LIST_H_


/*
typedef enum
{
	MUSIC_FILE_LIST,
	IMAGE_FILE_LIST,
	VIDEO_FILE_LIST,
	DIR_FILE_LIST,
	RAW_FILE_LIST,

	MEDIA_PLAYER_FILE_LIST_NUMBER,
}FileListType;


typedef enum
{
	SORT_RAND=0,
	SORT_NAME, 
	SORT_TYPE,
	SORT_NAME_A_Z,
	SORT_NAME_Z_A,
	SORT_TYPE_IMG_1ST,
	SORT_TYPE_MSC_1ST,
	SORT_DATE,
	SORT_SIZE,
}FileListSortType;
*/



typedef struct
{
	struct list_head	listpointer;
	
	FileType			type;	//file type

	unsigned int		size;
	
	unsigned char		attr; //file attribution
	unsigned int		time; //last modify time, hour(5b)<<11 |miniter(6b)<<5 |sec(5b)
	unsigned short	date; //(year-1980)(7b)<<9 | month(4b)<<5 | day(5b)

	char				in_play_list;
	
	union
	{
		struct
		{
			unsigned int	size; //file size
		}
		FileExt;

		struct
		{
			unsigned short	dirnum;	//sub-dirnum under the dir
			unsigned short	filenum;	//filenum under the dir
		}
		DirExt;
		
	}ExtInfo;
	
	char name[0]; //must locate at the end of this structure
}FileListItem, *pFileListItem;



typedef struct
{
	struct list_head				listpointer;

	FileListType					type;	//filelist media type
	
	char							*dirpath; //dir's full name that the filelist belongs to

	unsigned short				dirnum;	//not include dir "..\"!!
	unsigned short				filenum;

	FileListSortType				sorttype;
	unsigned char					sortorder;//0:little order,!0:big order
	
	unsigned short				pic_filenum;
	unsigned short  				*pic_list;
	int							current_pic_count;	
	unsigned short				music_filenum;
	unsigned short				*music_list;
	int							current_music_count;	
	unsigned short				video_filenum;
	unsigned short				*video_list;
	int							current_video_count;    
		
	struct list_head				head;
}FileList, *pFileList;

typedef struct
{
	BOOL			id_check_playlist;
	FileListSortType	mode;
}FileListCompareContext, *pFileListCompareContext;

int strcmp_c(const char *s1, const char *s2);
int strcmp_byex(const char *s1, const char *s2);

#endif

